package com.xiaoxiao.springbootstudy.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaoxiao.springbootstudy.pojo.Place;
import com.xiaoxiao.springbootstudy.service.PlaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class PlaceController {


    @Autowired
    private PlaceService placeService;

    /*处理加载商品产地列表的请求*/
    @GetMapping("/placeList")
    public List<Place> queryPlaceList(){
        QueryWrapper<Place> wrapper=new QueryWrapper<>();
        wrapper.select("place_id","place_name");
        return placeService.list(wrapper);
    }
}